{extend name="common/main"/}

{block name="body"}
    <!-- 标题栏 -->
    <div class="main-title">
        <h2>{:lang("_BEHAVIOR_LIST_")}</h2>
    </div>

    <div class="with-padding">
        <div class="row button-box tool-box">
            <div class="col-xs-8">
                <a class="btn btn-info" id="action_add" href="{:Url('editAction')}">{:lang("_NEW_GROWTH_WITH_SPACE_")}</a>
                <button class="btn btn-success ajax-post" target-form="ids"
                        url="{:Url('setstatus',array('status'=>1,'Model'=>'action'))}">{:lang("_KAI_WITH_SPACE_")}
                </button>
                <button class="btn btn-warning ajax-post" target-form="ids"
                        url="{:Url('setstatus',array('status'=>0,'Model'=>'action'))}">{:lang("_BAN_WITH_SPACE_")}
                </button>
                <button class="btn btn-danger ajax-post confirm" target-form="ids"
                        url="{:Url('setStatus',array('status'=>-1,'Model'=>'action'))}">{:lang("_DELETE_WITH_SPACE_")}
                </button>
            </div>

            <div class="col-xs-4 text-right">
                <form action="{:Url('saveAction')}" id="filter" method="post">        
                    <div class="select_box">
                        <select name="module" data-role="select_text" class="form-control"
                                onchange="$('#filter').submit()">
                            <option value="-1">{:lang("_ALL_")}</option>
                            {volist name="module" id="vo"}

                                {if condition="$vo['name'] eq  $current_module"}
                                    <option value="{$vo.name|default=''}" selected>{$vo.alias}</option>
                                {else/}
                                    <option value="{$vo.name|default=''}">{$vo.alias}</option>
                                {/if}

                            {/volist}
                        </select>
                    </div>
                </form>
            </div>
        </div>

        <!-- 数据列表 -->
        <div class="data-table">
            <table class="table table-bordered table-striped table-hover muu-table">
                <thead>
                <tr>
                    <th class="row-selected row-selected">
                        <input class="check-all" id="check-all" type="checkbox"/>
                        <label for="check-all"></label>
                    </th>
                    <th class="">{:lang("_NO_")}</th>
                    <th class="">{:lang("_IDENTIFICATION_")}</th>
                    <th class="">{:lang("_NAME_")}</th>
                    <th class="">{:lang("_THE_MODULE_")}</th>
                    <th class="">{:lang("_INTEGRAL_CHANGE_")}</th>
                    <th class="">{:lang("_TYPE_")}</th>
                    <th class="">{:lang("_RULE_")}</th>
                    <th class="">{:lang("_STATE_")}</th>
                    <th class="">{:lang("_OPERATION_")}</th>
                </tr>
                </thead>
                <tbody>
                {volist name="_list" id="vo"}
                    <tr>
                        <td>
                            <input class="ids" id="ids-{$vo.id}" type="checkbox" name="ids[]" value="{$vo.id}">
                            <label for="ids-{$vo.id}"></label>
                        </td>
                        <td>{$vo.id}</td>
                        <td><a href="{:Url('ActionLimit/limitlist',array('action'=>$vo['name']))}" title={:lang("_CHECK_THE_LIMIT_WITH_DOUBLE_")}>{$vo.name}</a>
                        </td>
                        <td><a href="{:Url('editAction?id='.$vo['id'])}">{$vo.title}</a></td>
                        <td>{empty name='vo.alias'}{:lang('_SYSTEM_')}{else /}{$vo.alias}{/empty}</td>
                        <td>{$vo.vary}</td>
                        <td><span>{:get_action_type($vo['type'])}</span></td>
                        <td>{$vo.remark}</td>
                        <td>{$vo.status_text}</td>
                        <td><a href="{:Url('editAction?id='.$vo['id'])}">{:lang("_EDIT_")}</a>
                            <a href="{:Url('setStatus?Model=action&ids='.$vo['id'].'&status='.abs(1-$vo['status']))}"
                               class="ajax-get">{$vo.status|show_status_op}</a>
                            <a href="{:Url('setStatus?Model=action&status=-1&ids='.$vo['id'])}" class="confirm ajax-get">{:lang("_DELETE_")}</a>
                        </td>
                    </tr>
                {/volist}
                </tbody>
            </table>
        </div>
        <!-- 分页-->
        <div class="page">{$page}</div>
        <!-- /分页-->

    </div>
    

{/block}
{block name="script"}
    <script type="text/javascript">
        $(function () {

        })
    </script>
{/block}
